package com.hibiscusking.feign;

import com.hibiscusking.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserServerFallbackFactory implements FallbackFactory<UserServer> {
    @Override
    public UserServer create(Throwable throwable) {
        return new UserServer() {
            @Override
            public User getUser(Long id) {
                return new User(-1L,"网络异常");
            }
        };
    }
}
